package com.jy.wms.web;

import com.joyi.gate.comm.SessionInfo;
import com.joyi.gate.safety.vo.UserInfo;
import com.jy.wms.common.base.BaseSessionInfo;
import com.jy.wms.pojo.SysHz;
import com.jy.wms.pojo.SysUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * @ProjectName: new-Wms
 * @Package: com.jy.wms.web
 * @ClassName: wmsSendCategoryRouter
 * @Description: TODO(收发类别)
 * @Author: xmx
 * @CreateDate: 2018/7/26 14:01
 * @UpdateUser: 更新者
 * @UpdateDate: 2018/7/26 14:01
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */

@Controller
@RequestMapping("/SendReceiveCategory")
public class wmsSendCategoryRouter {

    //主页面
    @RequestMapping(value = "/toMainPage")
    public String toMainPage() {
        return "sendReceiveCategory/mainPage";
    }
    //增加页面
    @RequestMapping(value = "/add")
    public String addSendCategory(Model model,HttpSession session) {

        UserInfo userinfo= (UserInfo) session.getAttribute(SessionInfo.USER_INFO);
        List<SysHz> hz=(List<SysHz>)session.getAttribute(BaseSessionInfo.SessionConsignor);
       String show_hzid= hz.get(0).getShow_hzid();
        model.addAttribute("show_hzid",show_hzid);
        return "sendReceiveCategory/addCategory";
    }

    /*跳转到修改页面*/
    @RequestMapping(value = "/editCategory")
    public String editKq(String id, Model model) {
        model.addAttribute("id",id);
        return "sendReceiveCategory/editCategory";
    }
    /*跳转到详情页面*/
    @RequestMapping(value = "/detailCategory")
    public String getFindKq(String id, Model model) {
        System.out.println("id："+id);
        model.addAttribute("id",id);
        return "sendReceiveCategory/detailCategory";
    }
}
